import Vue from 'vue'
import VueRouter from 'vue-router'
// 注册路由模块
Vue.use(VueRouter)
// 制定路由规则
const routes = [
  {
    path: '/',
    component: () => import('@/views/layout'),
    children: [
      {
        path: '',
        component: () => import('@/views/index')
      },
      {
        path: '/qa',
        component: () => import('@/views/qa')
      },
      {
        path: '/video',
        component: () => import('@/views/video')
      },
      {
        path: '/my',
        component: () => import('@/views/my')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/login')
  }
]
// 生成路由管理器实例对象
const router = new VueRouter({
  routes
})

export default router
